-
Notifications
You must be signed in to change notification settings - Fork 846
[재작업] #52 call-apply-decorator #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[재작업] #52 call-apply-decorator #272
Conversation
|
The trick is called *method borrowing*. | ||
|
||
We take (borrow) a join method from a regular array `[].join`. And use `[].join.call` to run it in the context of `arguments`. | ||
|
||
Why does it work? | ||
|
||
That's because the internal algorithm of the native method `arr.join(glue)` is very simple. | ||
|
||
Taken from the specification almost "as-is": | ||
위와 같은 방법을 *메서드 빌리기(method borrowing)* 라고 합니다. | ||
|
||
1. Let `glue` be the first argument or, if no arguments, then a comma `","`. | ||
2. Let `result` be an empty string. | ||
3. Append `this[0]` to `result`. | ||
4. Append `glue` and `this[1]`. | ||
5. Append `glue` and `this[2]`. | ||
6. ...Do so until `this.length` items are glued. | ||
7. Return `result`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
번역이 누락되어있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원문 변경으로 인한 번역 누락 확인 후 작업 부탁드립니다.
Please make the requested changes. After it, add a comment "/done". |
일단 닫고 하나씩 해보겠습니다 |
원문 변경후 다시 작업한것입니다.
리뷰 부탁드립니다.